local huiguang = fk.CreateSkill {
  name = "th_huiguang",
}

huiguang:addEffect("viewas", {
  anim_type = "offensive",
  prompt = "#th_huiguang",
  pattern = "fire__slash",
  mute_card = false,
  handly_pile = true,
  card_filter = function(self, player, to_select, selected)
    if #selected == 1 then
      return Fk:getCardById(selected[1]).type == Card.TypeBasic and Fk:getCardById(to_select).type == Card.TypeBasic
    end
    return #selected == 0
  end,
  view_as = function(self, player,cards)
    if #cards == 0 then return end
    if #cards == 1 then
      if Fk:getCardById(cards[1]).type == Card.TypeBasic then return end
    end
    local c = Fk:cloneCard("fire__slash")
    c.skillName = huiguang.name
    c:addSubcards(cards)
    return c
  end,
})
huiguang:addEffect("targetmod", {
  name = "#th_huiguang_targetmod",
  bypass_distances = function(self, player, skill, card, to)
    return card and table.contains(card.skillNames, "th_huiguang")
  end,
  extra_target_func = function(self, player, skill, card)
    if card and table.contains(card.skillNames, "th_huiguang") then
      return 2
    end
  end
})

Fk:loadTranslationTable{
  ["th_huiguang"] = "辉光",
  [":th_huiguang"] = "你可以将一张非基本牌或两张基本牌当无距离限制且目标上限+2的火【杀】使用。",

  ["#th_huiguang"] = "辉光：将一张非基本牌或两张基本牌当无距离限制且目标上限+2的火【杀】使用",
}

return huiguang